1 // ----------------------------------------------------------------------------------------------------------------------
2 // <summary>The Photon Chat Api enables clients to connect to a chat server and communicate with other clients.</summary>
3 // <remarks>ChatClient
is the main class of this api.</remarks>
4 // <copyright company=
"Exit Games GmbH">Photon Chat Api - Copyright (C) 2014 Exit Games GmbH</copyright>
5 // ----------------------------------------------------------------------------------------------------------------------

6
7 namespace
ExitGames.Client.Photon.Chat
8 {

9     ///
<summary>
10     ///
Callback interface for Chat client side. Contains callback methods to notify your app about updates.
11     ///
Must be provided to new ChatClient in constructor
12     ///
</summary>
13     
public interface IChatClientListener
14     {

15         ///
<summary>
16         ///
Disconnection happened.
17         ///
</summary>
18         
void OnDisconnected();
19
20         ///
<summary>
21         ///
Client is connected now.
22         ///
</summary>
23         ///
<remarks>
24         ///
Clients have to be connected before they can send their state, subscribe to channels and send any messages.
25         ///
</remarks>
26         
void OnConnected();
27
28         ///
<summary>The ChatClient's state changed. Usually, OnConnected and OnDisconnected are the callbacks to react to.</summary>
29         ///
<param name="state">The new state.</param>
30         
void OnChatStateChange(ChatState state);
31
32         ///
<summary>
33         ///
Notifies app that client got new messages from server
34         ///
Number of senders is equal to number of messages in 'messages'. Sender with number '0' corresponds to message with
35         ///
number '0', sender with number '1' corresponds to message with number '1' and so on
36         ///
</summary>
37         ///
<param name="channelName">channel from where messages came</param>
38         ///
<param name="senders">list of users who sent messages</param>
39         ///
<param name="messages">list of messages it self</param>
40         
void OnGetMessages(string channelName, string[] senders, object[] messages);
41
42         ///
<summary>
43         ///
Notifies client about private message
44         ///
</summary>
45         ///
<param name="sender">user who sent this message</param>
46         ///
<param name="message">message it self</param>
47         ///
<param name="channelName">channelName for private messages (messages you sent yourself get added to a channel per target username)</param>
48         
void OnPrivateMessage(string sender, object message, string channelName);
49
50         ///
<summary>
51         ///
Result of Subscribe operation. Returns per channelname if the channel is now subscribed.
52         ///
</summary>
53         ///
<param name="channels">Array of channel names.</param>
54         ///
<param name="results">Per channel result if subscribed.</param>
55         
void OnSubscribed(string[] channels, bool[] results);
56
57         ///
<summary>
58         ///
Result of Unsubscribe operation. Returns per channelname if the channel is now unsubscribed.
59         ///
</summary>
60         ///
<param name="channels">Array of channel names that are no longer subscribed.</param>
61         
void OnUnsubscribed(string[] channels);
62
63         ///
<summary>
64         ///
New status of another user (you get updates for users set in your friends list).
65         ///
</summary>
66         ///
<param name="user">Name of the user.</param>
67         ///
<param name="status">New status of that user.</param>
68         ///
<param name="gotMessage">True if the status contains a message you should cache locally. False: This status update does not include a message (keep any you have).</param>
69         ///
<param name="message">Message that user set.</param>
70         
void OnStatusUpdate(string user, int status, bool gotMessage, object message);
71     }
72 }


----------------------------------------------------------------------------------------------------------------------

The Photon Chat Api enables clients to connect to a chat server and communicate with other clients.

ChatClient is the main class of this api.

Photon Chat Api - Copyright (C) 2014 Exit Games GmbH

----------------------------------------------------------------------------------------------------------------------

Callback interface for Chat client side. Contains callback methods to notify your app about updates.

Must be provided to new ChatClient in constructor

Disconnection happened.

Client is connected now.

Clients have to be connected before they can send their state, subscribe to channels and send any messages.

The ChatClient's state changed. Usually, OnConnected and OnDisconnected are the callbacks to react to.

The new state.

Notifies app that client got new messages from server

Number of senders is equal to number of messages in 'messages'. Sender with number '0' corresponds to message with

number '0', sender with number '1' corresponds to message with number '1' and so on

channel from where messages came

list of users who sent messages

list of messages it self

Notifies client about private message

user who sent this message

message it self

channelName for private messages (messages you sent yourself get added to a channel per target username)

Result of Subscribe operation. Returns per channelname if the channel is now subscribed.

Array of channel names.

Per channel result if subscribed.

Result of Unsubscribe operation. Returns per channelname if the channel is now unsubscribed.

Array of channel names that are no longer subscribed.

New status of another user (you get updates for users set in your friends list).

Name of the user.

New status of that user.

True if the status contains a message you should cache locally. False: This status update does not include a message (keep any you have).

Message that user set.




Trò chơi Tic-Tac-Toe, game đánh caro full source code 53.515 lượt xem

Gõ tìm kiếm nhanh...